﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;


namespace TileWindowsService
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
            { 
                new HttpApiService()
            };


            ServiceControllerPermission scp = new ServiceControllerPermission(ServiceControllerPermissionAccess.Control, Environment.MachineName, "HttpApiService");
            scp.Assert();
            System.ServiceProcess.ServiceController serviceCon = new System.ServiceProcess.ServiceController("HttpApiService", Environment.MachineName);
            serviceCon.Start();
            //ServiceControllerPermission permission = new ServiceControllerPermission(System.Security.Permissions.PermissionState.Unrestricted);
            //ServiceController controller = new ServiceController("HttpApiService", ".");
            //controller.
            //controller.Start();
            // 
        }
    }

   
   

}
